<%@ page import="java.util.Map" %>
<%@ page import="java.util.List" %>
<%@ page pageEncoding="utf-8" %>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="/pages/head.jsp">
        <jsp:param value="管理员首页" name="title"/>
    </jsp:include>
    <style>
        .container {
            width: 50%;
            margin: 0 auto;

        }
    </style>
</head>
<body>
<jsp:include page="/pages/admin/admin_nav.jsp"/>
<div class="card-header border">
    <form class="form-inline"
          action="<%=request.getContextPath()%>/admin/admin_list_food.action"
          method="post">


        &nbsp;&nbsp;<a
            class="btn btn-outline-primary my-2 my-sm-0 form-control"
            href="#" data-toggle="modal" data-target="#admin_add_foodtype" role="button">添加菜品分类</a>
    </form>
</div>
<div class="container" align="center">

    <%--    表格--%>
    <table class="table">
        <thead>
        <tr>

            <th scope="col">ID</th>
            <th scope="col">typename</th>

            <th scope="col">删除</th>


        </tr>
        </thead>
        <tbody>
        <%
            List<Map<String, String>> types = (List<Map<String, String>>) request.getAttribute("types");
            for (Map<String, String> type : types) {
        %>
        <%--        <option value="<%=type.get("id")%>"--%>
        <%--                <%=type.get("id").equals(request.getParameter("s_type")) ? "selected" : ""%>>--%>
        <%--            <%=type.get("typename")%>--%>
        <%--        </option>--%>

        <tr>

            <th scope="row"><%=type.get("id")%>
            </th>

            <td><%=type.get("typename")%>
            </td>
            <%--            <td><a href="javascript:;" onclick="delbtn()" class="btn btn-danger">删除</a> </td>--%>
            <td><a href="admin_del_one_foodtype.action?id=<%=type.get("id")%>" class="btn btn-danger">删除</a></td>

        </tr>
        <%
            }
        %>

        </tbody>
    </table>
</div>
<jsp:include page="/pages/admin/admin_add_foodtype.jsp"/>

</body>
</html>